import http from './axios'

// 菜单管理接口
export function addmenu(data){
  return http.post('/api/menuadd',data)
}

export function getmenulist(){
  return http.get('/api/menulist',{
    params:{
      istree:true
    }
  })
}

export function getmenuinfo(params){
  return http.get('/api/menuinfo',{params})
}

export function getmenuedit(data){
  return http.post('/api/menuedit',data)
}

export function deletemenu(data){
  return http.post('/api/menudelete',data)
}

// 角色管理接口

export function addRole(data){
  return http.post('/api/roleadd',data)
}

export function getRoleList(){
  return http.get('/api/rolelist')
}

export function getRoleInfo(params){
  return http.get('/api/roleinfo',{params})
}

export function postEditRole(data){
  return http.post('/api/roleedit',data)
}

export function deleteRole(data){
  return http.post('/api/roledelete',data)
}

// 管理员接口管理

export function postAddUser(data){
  return http.post('/api/useradd',data)
}

export function getCountUser(){
  return http.get('/api/usercount')
}

export function getUserList(params){
  return http.get('/api/userlist',{params})
}

export function getUserInfo(params){
  return http.get('/api/userinfo',{params})
}

export function postEditUser(data){
  return http.post('/api/useredit',data)
}

export function postDeleteUser(data){
  return http.post('/api/userdelete',data)
}

export function postUserLogin(data){
  return http.post('/api/userlogin',data)
}

// 商品分类菜单管理
export function postAddCate(data){
  return http.post('/api/cateadd',data)
}

export function getCateList(params){
  return http.get('/api/catelist',{
    params:{
      istree:true
  }
  })
}

export function getCateInfo(params){
  return http.get('/api/cateinfo',{params})
}

export function getCateEdit(data){
  return http.post('/api/cateedit',data)
}

export function postDelCate(data){
  return http.post('/api/catedelete',data)
}

// 商品规格管理
export function postAddSpecs(data){
  return http.post('/api/specsadd',data)
}

export function getCountSpecs(){
  return http.get('/api/specscount')
}

export function getSpecsList(params){
  return http.get('/api/specslist',{
    params
  })
}

export function getSpecsInfo(params){
  return http.get('/api/specsinfo',{params})
}

export function getSpecsEdit(data){
  return http.post('/api/specsedit',data)
}

export function postDelSpecs(data){
  return http.post('/api/specsdelete',data)
}

// 商品管理接口

export function postAddGoods(data){
  return http.post('/api/goodsadd',data)
}

export function getCountGoods(){
  return http.get('/api/goodscount')
}

export function getGoodsList(params){
  return http.get('/api/goodslist',{
    params
  })
}

export function getGoodsInfo(params){
  return http.get('/api/goodsinfo',{params})
}

export function getGoodsEdit(data){
  return http.post('/api/goodsedit',data)
}

export function postDelGoods(data){
  return http.post('/api/goodsdelete',data)
}


// 会员管理接口
export function getMemberList(){
  return http.get('/api/memberlist')
}

export function getMemberInfo(params){
  return http.get('/api/memberinfo',{params})
}

export function getMemberEdit(data){
  return http.post('/api/memberedit',data)
}

// 轮播图管理接口

export function postAddBanner(data){
  return http.post('/api/banneradd',data)
}

export function getBannerList(){
  return http.get('/api/bannerlist')
}

export function getBannerInfo(params){
  return http.get('/api/bannerinfo',{params})
}

export function postBannerEdit(data){
  return http.post('/api/banneredit',data)
}

export function postDelBanner(data){
  return http.post('/api/bannerdelete',data)
}

// 轮播图管理接口

export function postAddSeck(data){
  return http.post('/api/seckadd',data)
}

export function getSeckList(){
  return http.get('/api/secklist')
}

export function getSeckInfo(params){
  return http.get('/api/seckinfo',{params})
}

export function postSeckEdit(data){
  return http.post('/api/seckedit',data)
}

export function postDelSeck(data){
  return http.post('/api/seckdelete',data)
}